package cc.aiee.alipay.config;

import java.io.Serializable;

import javax.validation.constraints.NotBlank;

import cc.aiee.core.bean.PayBaseConfig;
import cc.aiee.core.interfaces.PayJsonBeanInterface;
import cc.aiee.core.kit.KitJson;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@AllArgsConstructor
@NoArgsConstructor
public class AliPayConfig extends PayBaseConfig implements Serializable, PayJsonBeanInterface {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@NotBlank
	private String appId;

	@NotBlank
	private String appPrivateKey;

	@NotBlank
	private String alipayPublicKey;

	/**
	 * CharsetUtil.UTF_8; GBK 和 UTF-8 
	 */
	@NotBlank
	private String charset = "UTF-8";

	@NotBlank
	private String notifyUrl;

	/**
	 * 微信预授权冻结回调地址
	 */
	private String notifyUrlFreeze;
	
//	private String notifyUrlRefund;

	/**
	 * 收款方的支付宝唯一用户号(商户号)
	 */
	private String payeeUserId;
	
	@Override
	public String toJson() {
		return KitJson.toJSONString(this);
	}

	@Override
	public String toJson(boolean prettyFormat, boolean ignoreNull) {
		return KitJson.toJSONString(this, prettyFormat, ignoreNull);
	}

}
